﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="TEST1.aspx.cs" Inherits="Management_Tracking_TEST1" %>
<%--<%@ Register TagPrefix="ed" Namespace="OboutInc.Editor" Assembly="obout_Editor" %>--%>
<%@ Register Assembly="Obout.Ajax.UI" Namespace="Obout.Ajax.UI.HTMLEditor" TagPrefix="ed" %>
<%@ Import Namespace="System.IO" %>


<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" Runat="Server">

    <style type="text/css">
			
			.tdText {
                font:11px Verdana;
                color:#333333;
            }
      </style>
<link rel="stylesheet" href="example_styles/style.css" />
<script runat="server">
void Page_Load(object o, EventArgs e)
{
  if(Page.IsPostBack)
  {
//
//   Here one can save postbacked HTML content of HTMLEditor (editor.Content)
//
  }
  else
  {
//
//   Here one can set initial HTML content of HTMLEditor
//
   //StreamReader input;

   //input = new StreamReader(System.Web.HttpContext.Current.Server.MapPath("contents/Content1.txt"), System.Text.Encoding.ASCII);
   //editor.Content = input.ReadToEnd();
   //input.Close();
  }
}
</script>
<script type="text/JavaScript">
    function SelectedTextNodes() {
        var nodes = oboutGetEditor('editor').SelectedTextNodes();
        var output = "Selected Text Nodes content:\n\n";

        for (var i = 0; i < nodes.length; i++) output += "[" + nodes[i].data + "]\n";
        alert(output);
    }

    function TextSelected() {
        alert(oboutGetEditor('editor').TextSelected() ? "Some text selected" : "No text selected");
        alert(oboutGetEditor('editor').length);
    }
</script>
<style type="text/css">
       a {
               font:11px Verdana;
               color:#315686;
               text-decoration:underline;
       }

       a:hover {
               color:crimson;
       }
</style>
<span class="tdText"><b>ASP.NET HTML Editor - Working with selected text</b></span>
	    <br /><br /><br /><br />

        <input type="button" onclick="TextSelected();" value="Is some text selected"/>
        <input type="button" onclick="SelectedTextNodes();" value="Show selected Text Nodes"/>
        <ed:Editor PathPrefix="Editor_data/" FlashBrowse="myFlashBrowse.aspx" MediaBrowse="myMediaBrowse.aspx" ImageBrowse="myImageBrowse.aspx" UrlBrowse="myUrlBrowse.aspx" id="editor" runat="server"/>
        
        <br /><br />
            	    
        <a style="font-size:10pt;font-family:Tahoma" href="Default.aspx?type=ASPNET">?Back to examples</a>
        
</asp:Content>

